home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1999 / MacHack 1999.toast / The Hacks / OutOfContextMenus / Source / COutOfContextApp.h < prev    next >
Encoding:
Text File  |  1999-06-25  |  2.2 KB  |  116 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    COutOfContextApp.h                    ©1999 Eric Traut
  3. // ===========================================================================
  4.  
  5. #pragma once
  6.  
  7. #include <PP_Prefix.h>
  8. #include <LApplication.h>
  9.  
  10. #include <Events.h>
  11.  
  12. class CShadowWindow;
  13.  
  14. class COutOfContextApp : public PP_PowerPlant::LApplication
  15. {
  16.     public:
  17.         COutOfContextApp(void);
  18.  
  19.         virtual
  20.         ~COutOfContextApp(void);
  21.     
  22.         virtual Boolean
  23.         ObeyCommand(    PP_PowerPlant::CommandT     inCommand, 
  24.                         void *                         ioParam);    
  25.  
  26.         virtual void
  27.         FindCommandStatus(    PP_PowerPlant::CommandT     inCommand,
  28.                             Boolean &                    outEnabled, 
  29.                             Boolean &                    outUsesMark,
  30.                             PP_PowerPlant::Char16 &        outMark, 
  31.                             Str255                         outName);
  32.         
  33.         virtual Boolean
  34.         AttemptQuitSelf(    SInt32    inSaveOption);
  35.         
  36.         void
  37.         TearDownApp(void);
  38.         
  39.         static void
  40.         OutOfContextTearDownProc(void);
  41.         
  42.         CShadowWindow *
  43.         LookUpShadowWindow(    CWindowRecord *        inMacWindow);
  44.         
  45.         void
  46.         GiveShadowWindowsTime(Boolean inGNETime);
  47.  
  48.         static THz
  49.         GetAppHeap(void)
  50.         {
  51.             return sAppZone;
  52.         }
  53.         
  54.         static COutOfContextApp *            sOutOfContextApp;
  55.         
  56.     protected:
  57.         static void
  58.         InstallWNEPatch(void);
  59.  
  60.         static void
  61.         DeinstallWNEPatch(void);
  62.  
  63.         void
  64.         TearDownShadowWindows(void);
  65.  
  66.         virtual void
  67.         StartUp(void);
  68.  
  69.         void
  70.         InstallGNEFilter(void);
  71.  
  72.         void
  73.         RemoveGNEFilter(void);
  74.     
  75.         void
  76.         HandleContextualMenuClick(    EventRecord *        ioEvent, 
  77.                                     Boolean *            ioResult);
  78.  
  79.         void
  80.         DoFinderGNEFilter(    EventRecord *        ioEvent, 
  81.                             Boolean *            ioResult);
  82.         
  83.         static pascal void
  84.         GNEFilterPatch(        EventRecord *        ioEvent, 
  85.                             Boolean *            ioResult);
  86.  
  87.         void
  88.         Flush68KCodeCache(void);
  89.  
  90.         void
  91.         UpdateShadowWindowList(void);
  92.  
  93.         CShadowWindow *
  94.         LookUpWindowInShadowList(    const CWindowRecord *        inMacWindow);
  95.  
  96.     private:
  97.         TArray<CShadowWindow *>                mShadowWindowList;
  98.         
  99.         static GetNextEventFilterUPP        sChainedGNEFilter;
  100.         static GetNextEventFilterUPP        sNewGNEFilter;
  101.         static Ptr                            sGNEJumpIsland;
  102.         static Boolean                        sGNEPatchInstalled;
  103.         static THz                            sAppZone;
  104.         static Boolean                        sWNEPatchInstalled;
  105.         static Handle                        sWNEPatchHandle;
  106.         static MenuHandle                    sContextMenu1;
  107.         static MenuHandle                    sContextMenu2;
  108.         static SndChannelPtr                sSoundChannel;
  109. };
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.